/*****************************************************
*                                                                          
*               COPYRIGHT (c) 2015-2017 Broadlink Corporation              
*                         All Rights Reserved                              
*                                                                          
* The source code contained or described herein and all documents          
* related to the source code ("Material") are owned by Broadlink         
* Corporation or its licensors.  Title to the Material remains             
* with Broadlink Corporation or its suppliers and licensors.               
*                                                                          
* The Material is protected by worldwide copyright and trade secret        
* laws and treaty provisions. No part of the Material may be used,         
* copied, reproduced, modified, published, uploaded, posted, transmitted,  
* distributed, or disclosed in any way except in accordance with the       
* applicable license agreement.                                            
*                                                                          
* No license under any patent, copyright, trade secret or other            
* intellectual property right is granted to or conferred upon you by       
* disclosure or delivery of the Materials, either expressly, by            
* implication, inducement, estoppel, except in accordance with the         
* applicable license agreement.                                            
*                                                                          
* Unless otherwise agreed by Broadlink in writing, you may not remove or   
* alter this notice or any other notice embedded in Materials by Broadlink 
* or Broadlink's suppliers or licensors in any way.                        
*                                                                          
** Author: shengda.huang
** Date: 2018-09-19
*
*****************************************************/

#ifndef __SYSCOM_H_
#define __SYSCOM_H_

#ifdef __cplusplus
extern "C"{
#endif

/***** INCLUDES *************************************/

/***** DEFINES **************************************/

#define SYSCOM_DBG_LOG_ENABLE

#define SYSCON_ENV_NUM_MAX			4
#define SYSCOM_HANDLER_NUM_MAX      16

/***** TYPEDEFS *************************************/
typedef void * syscom_handle_t;

/***** CONSTANTS ************************************/

/***** VARIABLES ************************************/

/***** EXTERNAL VARIABLES ***************************/

/***** EXTERNAL FUNCTIONS ***************************/

/***** PROTOTYPES ***********************************/
int syscom_init(void);
syscom_handle_t syscom_open(int stack_size, unsigned char *buff, int size);
int syscom_close(syscom_handle_t syscom);
int syscom_register(syscom_handle_t syscom, \
					void (*handler)(unsigned char *pbuf, unsigned int len));
int syscom_send(syscom_handle_t syscom, unsigned short syscom_id, unsigned char *pbuf, int len);


#ifdef __cplusplus
}
#endif

#endif /* __SYSCOM_H_ */

